package com.tuling.learnjuc.demo;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class JVMCPU {
    private static ExecutorService service = Executors.newFixedThreadPool(5);
    private static Object lock = new Object();
    public static class CPUTask implements Runnable{

        @Override
        public void run() {
            synchronized (lock){
                long sum = 0L;
                while(true){
                    sum +=1;
                }
            }
        }
    }
    public static void main(String[] args) {

        CPUTask cpuTask = new CPUTask();
        service.execute(cpuTask);

    }
}